package com.jeeboot.modules.oss.service.impl;


import com.jeeboot.modules.oss.dao.SysOssDao;
import com.jeeboot.modules.oss.entity.SysOssEntity;
import com.jeeboot.modules.oss.service.SysOssService;
import com.jeeboot.system.common.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("sysOssService")
public class SysOssServiceImpl implements SysOssService {
	@Autowired
	private SysOssDao sysOssDao;
	
	@Override
	public SysOssEntity queryObject(Long id){
		return sysOssDao.findById(id).orElseGet(null);
	}
	
	@Override
	public Page<SysOssEntity> queryList(Query query, Pageable pageable){
		return sysOssDao.findAll(pageable);
	}
	
	@Override
	public Long queryTotal(){
		return sysOssDao.count();
	}
	
	@Override
	public void save(SysOssEntity sysOss){
		sysOssDao.save(sysOss);
	}
	
	@Override
	public void update(SysOssEntity sysOss){
		sysOssDao.save(sysOss);
	}
	
	@Override
	public void delete(Long id){
		sysOssDao.deleteById(id);
	}
	
	@Override
	public void deleteBatch(Long[] ids){
		sysOssDao.deleteInBatch(ids);
	}
	
}
